package day14;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class date {
    public static void main(String[] args) throws ParseException {
        // 字符串转日期
        LocalDateTime now = LocalDateTime.now();
        //System.out.println("Java 8当前时间: " + now);
        // 格式化输出
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm");
        System.out.println("格式化: " + now.format(formatter));
    }
    }

